#include <stdio.h>

void enterPassword(void);

int main()
{
	enterPassword();
}

void enterPassword(void)
{
	char password[20], userInput;
	int i;

	i = 0;
	userInput = ' ';

	while(userInput != 13){

		userInput = getch();

		if(userInput == 8){
			if(i != 0){
				printf("\b \b");
				password[i-1] = 0;
				i--;
			}
		}else{
			password[i] = userInput;
			printf("*");
			i++;
		}
	}

	password[i] = '\0';
}